Support function authentication with OpenFaaS IAM #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
If JWT authentication is enabled by setting the env variable
jwt_auth: true
in thestack.yml
file the watchdog requires an OpenFaaS function token for request authentication.Authentication tokens can be optioned through OpenFaaS IAM.
The watchdog verifies the token is valid and checks of an actor is authorized to invoke the function by looking at the
function
claim in the token and validating the permissions.Motivation and Context
Support IAM authentication for functions.
How Has This Been Tested?
Changes have been tested by running the watchdog locally and invoking it with and without a function token.
During these test the
OPENFAAS_NAME
andOPENFAAS_NAMESPACE
env variable were changed to simulate different functions in multiple namespaces.fprocess="env" \ jwt_auth=true \ jwt_auth_local=true \ jwt_auth_debug=true \ OPENFAAS_NAMESPACE=staging \ OPENFAAS_NAME=env \ port=8083 ./bin/fwatchdog-amd64
Changes have been tested E2E in cluster.
Types of changes
Checklist:
git commit -s